Try to make the 'resettime' work per
authorRobert Lipe <robertlipe@gpsbabel.org>
Wed, 31 Jul 2019 23:44:09 +0000 (18:44 -0500)
committerRobert Lipe <robertlipe@gpsbabel.org>
Wed, 31 Jul 2019 23:44:09 +0000 (18:44 -0500)
https://github.com/gpsbabel/gpsbabel/issues/350
Debugging shows it's sending a time to my USB Garmin, but since this seems
to be a non-rollover device, the time is borked on mine anyway.

garmin.cc

index 9f5636ca09cda8cab0d316c3e3ea3107385e3958..f46de66579773d8eef2eac0741e222e9809b7673 100644 (file)
--- a/garmin.cc
+++ b/garmin.cc
@@ -144,16 +144,6 @@ rw_init(const QString& fname)
     return;
   }
 
-  /*
-   * THis is Gross. The B&W Vista sometimes sets its time decades into
-   * the future with no way to reset it.  This apparently can "cure"
-   * an affected unit.
-   */
-  if (resettime) {
-    GPS_Command_Send_Time(qPrintable(fname), current_time().toTime_t());
-    return;
-  }
-
   if (categorybitsopt) {
     categorybits = strtol(categorybitsopt, nullptr, 0);
   }
@@ -175,6 +165,18 @@ rw_init(const QString& fname)
   if (GPS_Init(qPrintable(fname)) < 0) {
     fatal(MYNAME ":Can't init %s\n", qPrintable(fname));
   }
+
+  /*
+   * THis is Gross. The B&W Vista sometimes sets its time decades into
+   * the future with no way to reset it.  This apparently can "cure"
+   * an affected unit.
+   */
+  if (resettime) {
+    GPS_User("Issuing Time Reset...\n");
+    GPS_Command_Send_Time(qPrintable(fname), current_time().toTime_t());
+    GPS_User("done.\n");
+  }
+
   portname = xstrdup(qPrintable(fname));
 
   if (baud && baud != DEFAULT_BAUD) {